package com.realtest.baidu;


import java.util.Scanner;

/**
 * @Author: Ethan Yankang
 * @Program: Interview
 * @Date: 2024-08-22 19:08
 **/
//暴力超时了，应该使用dp
public class tiezi {
    //
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] num1 = new int[n];
        int[] num2 = new int[n];
        for (int i = 0; i < n; i++) {
            num1[i] = input.nextInt();
        }
        for (int i = 0; i < n; i++) {
            num2[i] = input.nextInt();
        }
        System.out.println(max(n,num1,num2));
    }

    static int max(int n,int[] num1,int[] num2){
        //    找在这两个数组中，找同一方的差值最大的元素对组合即可，注意这里一定是同正、同负。以同正为例
        int sum0 = 0;
        int sum1= 0;
        for (int i = 0; i < n; i++) {
            int cur = num1[i] - num2[i];
            if (cur > 0) {
                sum0 += cur;
            }else {
                sum1 -= cur;
            }
        }
        return Math.max(sum0,sum1);
    }
}
